Skip to content

lua: support luzer-based testing#14610

Open
ligurio wants to merge 1 commit intogoogle:masterfrom
ligurio:ligurio/test-lua-with-luzer
Open

lua: support luzer-based testing#14610
ligurio wants to merge 1 commit intogoogle:masterfrom
ligurio:ligurio/test-lua-with-luzer

Conversation

@ligurio
Copy link
Copy Markdown
Contributor

@ligurio ligurio commented Dec 19, 2025

Depends on #13929
Depends on ligurio/luzer#74
Depends on ligurio/lunapark#179
Depends on ligurio/luzer#82
Related to ligurio/lunapark#180
Related to ligurio/luzer#83

@github-actions
Copy link
Copy Markdown

ligurio is either the primary contact or is in the CCs list of projects/lua.
ligurio has previously contributed to projects/lua. The previous PR was #12685
ligurio is integrating a new project:
- Main repo: https://github.com/ligurio/luzer
- Criticality score: 0.23736

@ligurio ligurio force-pushed the ligurio/test-lua-with-luzer branch from 6bca742 to 648bcfa Compare January 17, 2026 15:47
@ligurio ligurio marked this pull request as draft January 30, 2026 07:34
ligurio added a commit to ligurio/luzer that referenced this pull request Mar 27, 2026
Sometimes one need to compile a luzer module with a non-system Lua
library and headers, for which the LUA_LIBRARIES and
LUA_INCLUDE_DIR CMake options are used. The patch adds variables
for the rockspec to set these options via environment variables:
LUA_LIBRARIES and LUA_INCLUDE_DIR.

Needed for google/oss-fuzz#14610
@ligurio ligurio force-pushed the ligurio/test-lua-with-luzer branch from 648bcfa to b14c354 Compare March 27, 2026 12:26
ligurio added a commit to ligurio/lunapark that referenced this pull request Mar 27, 2026
The patch itnroduces a CMake option ENABLE_LIBFUZZER_STATIC_LINKAGE
that enables static linkage wituh libFuzzer. By default linkage
is disabled.

Needed for google/oss-fuzz#14610
@ligurio ligurio force-pushed the ligurio/test-lua-with-luzer branch 3 times, most recently from 5b5ddaa to ff72ffc Compare March 27, 2026 14:35
@ligurio ligurio marked this pull request as ready for review March 27, 2026 14:40
ligurio added a commit to ligurio/luzer that referenced this pull request Mar 27, 2026
Sometimes one need to compile a luzer module with a non-system Lua
library and headers, for which the LUA_LIBRARIES and
LUA_INCLUDE_DIR CMake options are used. The patch adds variables
for the rockspec to set these options via environment variables:
LUA_LIBRARIES and LUA_INCLUDE_DIR.

Needed for google/oss-fuzz#14610
@ligurio ligurio force-pushed the ligurio/test-lua-with-luzer branch 4 times, most recently from 48eff90 to 5aca8b2 Compare March 27, 2026 15:42
ligurio added a commit to ligurio/luzer that referenced this pull request Apr 6, 2026
Sometimes one need to build a luzer module using rockspec with
a non-system Lua library and headers, for which the CMake options
LUA_LIBRARIES and LUA_INCLUDE_DIR are used. The patch adds
variables for the rockspec to set these options via environment
variables: CMAKE_LUA_LIBRARIES, CMAKE_LUA_INCLUDE_DIR,
ENABLE_LUAJIT and LUAJIT_FRIENDLY_MODE.

luarocks install --lua-version 5.1 --verbose --tree=lua_modules \
  luzer-scm-1.rockspec ENABLE_LUAJIT=ON LUAJIT_FRIENDLY_MODE=ON

Needed for google/oss-fuzz#14610
ligurio added a commit to ligurio/luzer that referenced this pull request Apr 6, 2026
Sometimes one needs to build a luzer module using rockspec with
a non-system Lua library and headers, for which the CMake options
LUA_LIBRARIES and LUA_INCLUDE_DIR are used. The patch adds
variables for the rockspec to set these options via environment
variables: CMAKE_LUA_LIBRARIES, CMAKE_LUA_INCLUDE_DIR,
ENABLE_LUAJIT and LUAJIT_FRIENDLY_MODE.

luarocks install --lua-version 5.1 --verbose --tree=lua_modules \
  luzer-scm-1.rockspec ENABLE_LUAJIT=ON LUAJIT_FRIENDLY_MODE=ON

Needed for google/oss-fuzz#14610
ligurio added a commit to ligurio/luzer that referenced this pull request Apr 6, 2026
Sometimes one needs to build a luzer module using rockspec with
a non-system Lua library and headers, for which the CMake options
LUA_LIBRARIES and LUA_INCLUDE_DIR are used. The patch adds
variables for the rockspec to set these options via environment
variables: CMAKE_LUA_LIBRARIES, CMAKE_LUA_INCLUDE_DIR,
ENABLE_LUAJIT and LUAJIT_FRIENDLY_MODE.

luarocks install --tree=lua_modules luzer-scm-1.rockspec \
  ENABLE_LUAJIT=ON LUAJIT_FRIENDLY_MODE=ON

Needed for google/oss-fuzz#14610
ligurio added a commit to ligurio/luzer that referenced this pull request Apr 7, 2026
Sometimes one needs to build a luzer module using rockspec with
a non-system Lua library and headers or set other CMake options
before building. The patch adds variables for the rockspec to set
the following CMake options via environment variables:
CMAKE_LUA_LIBRARIES, CMAKE_LUA_INCLUDE_DIR, ENABLE_LUAJIT and
LUAJIT_FRIENDLY_MODE:

luarocks install --tree=lua_modules luzer-scm-1.rockspec \
  ENABLE_LUAJIT=ON LUAJIT_FRIENDLY_MODE=ON

The patch also renames a CMake variables used for setting custom
Lua library and Lua include directory: LUA_LIBRARIES to
CMAKE_LUA_LIBRARIES and LUA_INCLUDE_DIR to CMAKE_LUA_INCLUDE_DIR.
This is needed because with empty environment variables
LUA_LIBRARIES and LUA_INCLUDE_DIR passed to luarocks breaks CMake
module for finding Lua package:

CMake Error at /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Lua (missing: LUA_LIBRARIES LUA_INCLUDE_DIR) (Required is at least version "5.1")
Call Stack (most recent call first):
  /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.28/Modules/FindLua.cmake:236 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:49 (find_package)

Needed for google/oss-fuzz#14610
ligurio added a commit to ligurio/luzer that referenced this pull request Apr 7, 2026
Sometimes one needs to build a luzer module using rockspec with
a non-system Lua library and headers or set other CMake options
before building. The patch adds variables for the rockspec to set
the following CMake options via environment variables:
CMAKE_LUA_LIBRARIES, CMAKE_LUA_INCLUDE_DIR, ENABLE_LUAJIT and
LUAJIT_FRIENDLY_MODE:

luarocks install --tree=lua_modules luzer-scm-1.rockspec \
  ENABLE_LUAJIT=ON LUAJIT_FRIENDLY_MODE=ON

The patch also renames a CMake variables used for setting custom
Lua library and Lua include directory: LUA_LIBRARIES to
CMAKE_LUA_LIBRARIES and LUA_INCLUDE_DIR to CMAKE_LUA_INCLUDE_DIR.
This is needed because with empty environment variables
LUA_LIBRARIES and LUA_INCLUDE_DIR passed to luarocks breaks CMake
module for finding Lua package:

CMake Error at /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Lua (missing: LUA_LIBRARIES LUA_INCLUDE_DIR) (Required is at least version "5.1")
Call Stack (most recent call first):
  /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.28/Modules/FindLua.cmake:236 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:49 (find_package)

Needed for google/oss-fuzz#14610
ligurio added a commit to ligurio/luzer that referenced this pull request Apr 7, 2026
Sometimes one needs to build a luzer module using rockspec with
a non-system Lua library and headers or set other CMake options
before building. The patch adds variables for the rockspec to set
the following CMake options via environment variables:
CMAKE_LUA_LIBRARIES, CMAKE_LUA_INCLUDE_DIR, ENABLE_LUAJIT,
LUAJIT_FRIENDLY_MODE and OSS_FUZZ:

luarocks install --tree=lua_modules luzer-scm-1.rockspec \
  ENABLE_LUAJIT=ON LUAJIT_FRIENDLY_MODE=ON

The patch also renames a CMake variables used for setting custom
Lua library and Lua include directory: LUA_LIBRARIES to
CMAKE_LUA_LIBRARIES and LUA_INCLUDE_DIR to CMAKE_LUA_INCLUDE_DIR.
This is needed because with empty environment variables
LUA_LIBRARIES and LUA_INCLUDE_DIR passed to luarocks breaks CMake
module for finding Lua package:

CMake Error at /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Lua (missing: LUA_LIBRARIES LUA_INCLUDE_DIR) (Required is at least version "5.1")
Call Stack (most recent call first):
  /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.28/Modules/FindLua.cmake:236 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:49 (find_package)

Needed for google/oss-fuzz#14610
ligurio added a commit to ligurio/luzer that referenced this pull request Apr 7, 2026
Sometimes one needs to build a luzer module using rockspec with
a non-system Lua library and headers or set other CMake options
before building. The patch adds variables for the rockspec to set
the following CMake options via environment variables:
ENABLE_LUAJIT, LUAJIT_FRIENDLY_MODE and OSS_FUZZ:

luarocks install --tree=lua_modules luzer-scm-1.rockspec \
  ENABLE_LUAJIT=ON LUAJIT_FRIENDLY_MODE=ON

The patch also renames CMake variables used for setting a custom
Lua library and Lua include directory: LUA_LIBRARIES to
CMAKE_LUA_LIBRARIES and LUA_INCLUDE_DIR to CMAKE_LUA_INCLUDE_DIR.
This is needed because with empty environment variables
LUA_LIBRARIES and LUA_INCLUDE_DIR passed to luarocks breaks CMake
module for finding Lua package:

CMake Error at /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Lua (missing: LUA_LIBRARIES LUA_INCLUDE_DIR) (Required is at least version "5.1")
Call Stack (most recent call first):
  /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.28/Modules/FindLua.cmake:236 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:49 (find_package)

After renaming these options can be specified for luarocks.

Needed for google/oss-fuzz#14610
ligurio added a commit to ligurio/luzer that referenced this pull request Apr 7, 2026
Sometimes one needs to build a luzer module using rockspec with
a non-system Lua library and headers or set other CMake options
before building. The patch adds variables for the rockspec to set
the following CMake options via environment variables:
ENABLE_LUAJIT, LUAJIT_FRIENDLY_MODE and OSS_FUZZ:

luarocks install --tree=lua_modules luzer-scm-1.rockspec \
  ENABLE_LUAJIT=ON LUAJIT_FRIENDLY_MODE=ON

The patch also renames CMake variables used for setting a custom
Lua library and Lua include directory: LUA_LIBRARIES to
CMAKE_LUA_LIBRARIES and LUA_INCLUDE_DIR to CMAKE_LUA_INCLUDE_DIR.
This is needed because with empty environment variables
LUA_LIBRARIES and LUA_INCLUDE_DIR passed to luarocks breaks CMake
module for finding Lua package:

CMake Error at /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Lua (missing: LUA_LIBRARIES LUA_INCLUDE_DIR) (Required is at least version "5.1")
Call Stack (most recent call first):
  /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.28/Modules/FindLua.cmake:236 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:49 (find_package)

After renaming these options can be specified for luarocks.

Needed for google/oss-fuzz#14610
ligurio added a commit to ligurio/luzer that referenced this pull request Apr 7, 2026
Sometimes one needs to build a luzer module using rockspec with
a non-system Lua library and headers or set other CMake options
before building. The patch adds variables for the rockspec to set
the following CMake options via environment variables:
ENABLE_LUAJIT, LUAJIT_FRIENDLY_MODE and OSS_FUZZ:

luarocks install --tree=lua_modules luzer-scm-1.rockspec \
  ENABLE_LUAJIT=ON LUAJIT_FRIENDLY_MODE=ON

The patch also renames CMake variables used for setting a custom
Lua library and Lua include directory: LUA_LIBRARIES to
CMAKE_LUA_LIBRARIES and LUA_INCLUDE_DIR to CMAKE_LUA_INCLUDE_DIR.
This is needed because with empty environment variables
LUA_LIBRARIES and LUA_INCLUDE_DIR passed to luarocks breaks CMake
module for finding Lua package:

CMake Error at /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Lua (missing: LUA_LIBRARIES LUA_INCLUDE_DIR) (Required is at least version "5.1")
Call Stack (most recent call first):
  /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.28/Modules/FindLua.cmake:236 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:49 (find_package)

After renaming these options can be specified for luarocks.
The patch also sorts variables in alphabetical order.

Needed for google/oss-fuzz#14610
ligurio added a commit to ligurio/luzer that referenced this pull request Apr 7, 2026
Sometimes one needs to build a luzer module using rockspec with
a non-system Lua library and headers or set other CMake options
before building. The patch adds variables for the rockspec to set
the following CMake options via environment variables:
ENABLE_LUAJIT, LUAJIT_FRIENDLY_MODE and OSS_FUZZ:

luarocks install --tree=lua_modules luzer-scm-1.rockspec \
  ENABLE_LUAJIT=ON LUAJIT_FRIENDLY_MODE=ON

The patch also renames CMake variables used for setting a custom
Lua library and Lua include directory: LUA_LIBRARIES to
CMAKE_LUA_LIBRARIES and LUA_INCLUDE_DIR to CMAKE_LUA_INCLUDE_DIR.
This is needed because with empty environment variables
LUA_LIBRARIES and LUA_INCLUDE_DIR passed to luarocks breaks CMake
module for finding Lua package:

CMake Error at /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Lua (missing: LUA_LIBRARIES LUA_INCLUDE_DIR) (Required is at least version "5.1")
Call Stack (most recent call first):
  /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.28/Modules/FindLua.cmake:236 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:49 (find_package)

After renaming these options can be specified for luarocks.
The patch also sorts variables in alphabetical order.

Needed for google/oss-fuzz#14610
ligurio added a commit to ligurio/lunapark that referenced this pull request Apr 7, 2026
The patch itnroduces a CMake option ENABLE_LIBFUZZER_STATIC_LINKAGE
that enables static linkage wituh libFuzzer. By default linkage
is disabled.

Needed for google/oss-fuzz#14610
ligurio added a commit to ligurio/luzer that referenced this pull request Apr 7, 2026
The previous patch is not set LUA_INCLUDE_DIR when custom Lua
include directory is used. The patch fixes that. Also, rockspec
has missed variables CMAKE_LUA_LIBRARIES and CMAKE_LUA_INCLUDE_DIR.
The patch adds these variables.

Follows up the commit 2a58b8a
("rockspec: propagate CMake options").

Needed for google/oss-fuzz#14610
ligurio added a commit to ligurio/lunapark that referenced this pull request Apr 7, 2026
The patch itnroduces a CMake option DISABLE_LIBFUZZER_STATIC_LINKAGE
that disables static linkage wituh libFuzzer. By default linkage
is enabled.

Needed for google/oss-fuzz#14610
@ligurio ligurio force-pushed the ligurio/test-lua-with-luzer branch from 5aca8b2 to 73f555c Compare April 7, 2026 13:40
@ligurio ligurio force-pushed the ligurio/test-lua-with-luzer branch from 73f555c to 0e03ce8 Compare April 7, 2026 14:03
ligurio added a commit to ligurio/luzer that referenced this pull request Apr 7, 2026
The previous patch is not set LUA_INCLUDE_DIR when custom Lua
include directory is used. The patch fixes that. Also, rockspec
has missed variables CMAKE_LUA_LIBRARIES and CMAKE_LUA_INCLUDE_DIR.
The patch adds these variables.

Follows up the commit 2a58b8a
("rockspec: propagate CMake options").

Needed for google/oss-fuzz#14610
@ligurio ligurio force-pushed the ligurio/test-lua-with-luzer branch from d24af8f to c169cce Compare April 7, 2026 14:22
ligurio added a commit to ligurio/lunapark that referenced this pull request Apr 7, 2026
The patch itnroduces a CMake option DISABLE_LIBFUZZER_STATIC_LINKAGE
that disables static linkage wituh libFuzzer. By default linkage
is enabled.

Needed for google/oss-fuzz#14610
@ligurio ligurio force-pushed the ligurio/test-lua-with-luzer branch 2 times, most recently from ad3c460 to e4accfb Compare April 7, 2026 14:51
sudo python infra/helper.py build_fuzzers lua
sudo python infra/helper.py check_build lua utf8_char_test

Related to ligurio/lunapark#180
Related to ligurio/luzer#83
@ligurio ligurio force-pushed the ligurio/test-lua-with-luzer branch from e4accfb to 323e75d Compare April 7, 2026 15:25
@ligurio
Copy link
Copy Markdown
Contributor Author

ligurio commented Apr 7, 2026

@DavidKorczynski ok to merge?

@ligurio
Copy link
Copy Markdown
Contributor Author

ligurio commented Apr 9, 2026

@jonathanmetzman ok to merge?

@DavidKorczynski
Copy link
Copy Markdown
Collaborator

I haven't followed the luzer PRs closely, but is this a libfuzzer based fuzzing approach? just to confirm it is compatible with the clusterfuzz infra

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants